
const { isProd } = require('../utils/env')

let REDIS_CONFIG = {
  port: 6379,
  host: '127.0.0.1',
}

let MYSQL_CONFIG = {
  host: 'localhost',
  dialect: 'mysql',
  port:3306,
  username: 'root',
  password: 'mud58411057',
  dataBase:'koa2_web_db'
}
if (isProd ) {

  REDIS_CONFIG = {
    port: 6379,
    host: '127.0.0.1',
  }
  MYSQL_CONFIG = {
    host: 'localhost',
    dialect: 'mysql',
    port: 3306,
    username: 'root',
    password: 'mud58411057',
    dataBase: 'koa2_web_db'
  }
  MYSQL_CONFIG.pool = {
    max: 5,
    min: 0,
    idle: 10000, // 连接池10s 内未被使用，连接池将被使用
  }
}

module.exports = {
  MYSQL_CONFIG: MYSQL_CONFIG,
  REDIS_CONFIG,
}